<!DOCTYPE html>
<html>
<!--
Copyright 2010 The Closure Library Authors. All Rights Reserved.

Use of this source code is governed by the Apache License, Version 2.0.
See the COPYING file for details.
-->
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Closure Unit Test - goog._jsbinarysize.button</title>
  <script src="../../base.js"></script>
  <script src="jsbinarysizebutton.js"></script>
  <script>
    goog.require("goog.testing.jsunit");
  </script>
  <link rel="stylesheet" type="text/css" href="../../demos/css/demo.css">
  <link rel="stylesheet" type="text/css" href="../../demos/css/button.css">
  <script>
  function setUp() {
    goog.dom.getElement('b1').innerHTML = '';
    goog.dom.getElement('cb1').innerHTML = '';

  }

  function tearDown() {
    goog.dom.getElement('b1').innerHTML = '';
    goog.dom.getElement('cb1').innerHTML = '';
  }

  function testDrawButton() {
    drawButtons();
    var buttonElem = goog.dom.getElement('b1').firstChild
    assertNotNull("Button container was not rendered", buttonElem);
    assertEquals("Button does not have correct title", "I changed the tooltip.",
        buttonElem.title);
  }

  function testDrawCustomButton() {
    drawButtons();
    var buttonElems = goog.dom.getElement('cb1').childNodes
    assertEquals("Incorrect number of buttons rendered", 7, buttonElems.length);
  }
  </script>
</head>
<body>
<fieldset>
  <legend>Buttons should be rendered here <button onclick="drawButtons()">
    render</button></legend>

  <div id="buttons">
    <div id="b1"></div>
    <div id="cb1"></div>
  </div>
</fieldset>
</body>

</html>
